home *** CD-ROM | disk | FTP | other *** search
- Extracts substrings from variables.
-
- SSTR var [delim] [/E] [/L | /R]
-
- var is the name of the variable from which the substring is
- to be extracted. SSTR replaces the content of 'var' with
- the substring.
- delim is the string which delimits the substring. MacDOS searches
- 'var' and stops when it finds 'delim'. Depending on the
- presence of switches, MacDOS extract from 'var' the
- substring on the left or on the right of 'delim'. If 'delim'
- is empty or missing or if 'delim' is not found within 'var',
- 'var' is left unchanged. An error condition occurs when 'var'
- does not contain 'delim'.
- Note that 'delim' must precede any switch if it begins with '/'.
- /E searches 'var' from the End (i.e. from right to left).
- Without /E, SSTR searches 'var' from left to right.
- /L extracts the substring on the Left of 'delim' (this is the
- default).
- /R extracts the substring on the Right of 'delim'.
-
- /L and /R cannot be present simultaneously. Note that the searches
- are always case sensitive. Use TOUPPER to convert strings to upper
- case, so that searches can be made case insensitive.
-
- Examples:
- ! initially VAR contains: "a few chars and nothing more"
- SSTR VAR "and nothing"
- ! VAR now contains: "a few chars "
- SSTR VAR /E " "
- ! VAR now contains: "a few chars"
- SSTR VAR w /R
- ! VAR now contains: " chars"
-